import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/emergency_res_goods_entity.dart';

EmergencyResGoodsEntity $EmergencyResGoodsEntityFromJson(Map<String, dynamic> json) {
  final EmergencyResGoodsEntity emergencyResGoodsEntity = EmergencyResGoodsEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    emergencyResGoodsEntity.companyCode = companyCode;
  }
  final String? contactNumber = jsonConvert.convert<String>(json['contactNumber']);
  if (contactNumber != null) {
    emergencyResGoodsEntity.contactNumber = contactNumber;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    emergencyResGoodsEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    emergencyResGoodsEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    emergencyResGoodsEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    emergencyResGoodsEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    emergencyResGoodsEntity.id = id;
  }
  final String? locationOfTheRegion = jsonConvert.convert<String>(json['locationOfTheRegion']);
  if (locationOfTheRegion != null) {
    emergencyResGoodsEntity.locationOfTheRegion = locationOfTheRegion;
  }
  final String? nameOfMaterialPoint = jsonConvert.convert<String>(json['nameOfMaterialPoint']);
  if (nameOfMaterialPoint != null) {
    emergencyResGoodsEntity.nameOfMaterialPoint = nameOfMaterialPoint;
  }
  final String? place = jsonConvert.convert<String>(json['place']);
  if (place != null) {
    emergencyResGoodsEntity.place = place;
  }
  final String? responsiblePerson = jsonConvert.convert<String>(json['responsiblePerson']);
  if (responsiblePerson != null) {
    emergencyResGoodsEntity.responsiblePerson = responsiblePerson;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    emergencyResGoodsEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    emergencyResGoodsEntity.updateById = updateById;
  }
  final String? estimateName = jsonConvert.convert<String>(json['estimateName']);
  if (estimateName != null) {
    emergencyResGoodsEntity.estimateName = estimateName;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    emergencyResGoodsEntity.updateDate = updateDate;
  }
  return emergencyResGoodsEntity;
}

Map<String, dynamic> $EmergencyResGoodsEntityToJson(EmergencyResGoodsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['contactNumber'] = entity.contactNumber;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['locationOfTheRegion'] = entity.locationOfTheRegion;
  data['nameOfMaterialPoint'] = entity.nameOfMaterialPoint;
  data['place'] = entity.place;
  data['responsiblePerson'] = entity.responsiblePerson;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['estimateName'] = entity.estimateName;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension EmergencyResGoodsEntityExtension on EmergencyResGoodsEntity {
  EmergencyResGoodsEntity copyWith({
    String? companyCode,
    String? contactNumber,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    String? locationOfTheRegion,
    String? nameOfMaterialPoint,
    String? place,
    String? responsiblePerson,
    String? updateBy,
    String? updateById,
    String? estimateName,
    String? updateDate,
  }) {
    return EmergencyResGoodsEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..contactNumber = contactNumber ?? this.contactNumber
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..locationOfTheRegion = locationOfTheRegion ?? this.locationOfTheRegion
      ..nameOfMaterialPoint = nameOfMaterialPoint ?? this.nameOfMaterialPoint
      ..place = place ?? this.place
      ..responsiblePerson = responsiblePerson ?? this.responsiblePerson
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..estimateName = estimateName ?? this.estimateName
      ..updateDate = updateDate ?? this.updateDate;
  }
}
